
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>GeoPuebla01</title>
	<?php 
		include "Global.php";
		GetMap()
	?>
    <script type="text/javascript">
	var map = null;

function zoom(x, y){
				map.setCenter(new GLatLng(x, y), 10);
		}
	
function initialize() {
  	if (GBrowserIsCompatible()) {
			map = new GMap2(document.getElementById("map_canvas"));
			map.addControl(new GSmallMapControl());
			map.addControl(new GMapTypeControl());
			map.setCenter(new GLatLng(19.043341, -98.198397), 16);
  
		// Creates a marker at the given point
		// Clicking the marker will hide it
		function createMarker(point, name, adress, moreinfo, image) {
	  	var marker = new GMarker(point);
	  	marker.value = point;
	  	GEvent.addListener(marker, "click", function() {
			var v='37.4419';
			var c='-122.1419';
			var myHtml = "<form action='#' onsubmit='zoom(37.4419,-122.1419)'><h1>" + name + "</h1><img src='" + image + "' height='300'><p>Adress: " + adress + "</p><p>" + moreinfo + " estas son 'v' y 'c'</p> <input type='submit' value='CreateTour'></form>";
			map.openInfoWindowHtml(point, myHtml);
	  	});
	  return marker;
	}

  
  	<?php

	//Conexion a mysql y a la base de datos
	$connection = DBConnect();
	
	$query="select * FROM places"; 
			$resultado = mysql_query($query) or die ('\n error en query $query' . mysql_error());
			while($row = mysql_fetch_assoc($resultado)){
				$x=$row['CoordX'];
				$y=$row['CoordY'];
				$name=$row['Name'];
				$adress=$row['Adress'];
				$mi=$row['MoreInfo'];
				$image=$row['Image'];
				echo "map.addOverlay(createMarker(new GLatLng($x, $y), '$name', '$adress', '$mi', '$image'));";
			}
	
	DBCLose($connection);
	?>

   
  }
}
    </script>
  </head>

  <body onload="initialize()" onunload="GUnload()">
    <div id="map_canvas" style="width: 1000px; height: 600px"></div>
  </body>

</html>
